uni |
您所在的位置:网站首页 › uniapp button跳转 › uni |
A页面用uni.navigateTo跳转一个渲染外部链接的内部B页面 url是文件路径。要用encodeURIComponent编码。不然路径会不完整 //A页面 tapdetail: function(i) { let url='http://saas.juwoxing.com/order/newpage/share/article_share.html?id='+i+'' url = encodeURIComponent(url) uni.navigateTo({ url:'softwendetail/softwendetail?url='+url }) },渲染外部要用web-view 记得接收到传过来的路径要用decodeURIComponent解码。实现跳转外部链接 //B页面 export default { data() { return { url:'', title:'' } }, onLoad(op) { console.log(op.url) this.url = decodeURIComponent(op.url); console.log(this.url) }, onReady(){//改变标题 uni.setNavigationBarTitle({ title:this.title }) } }
|
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |